package com.mazaiting.redeye.module.face

import android.hardware.Camera
import com.mazaiting.face.ui.FaceDetectActivity
import com.mazaiting.face.ui.config.FaceStatusEnum
import com.mazaiting.face.ui.interfaces.IDetectStrategy
import com.mazaiting.face.ui.module.BaseDetectStrategyModule
import com.mazaiting.redeye.module.user.login.LoginPresenter

import javax.inject.Inject

/***
 *
 *
 *                                                    __----~~~~~~~~~~~------___
 *                                   .  .   ~~//====......          __--~ ~~
 *                   -.            \_|//     |||\\  ~~~~~~::::... /~
 *                ___-==_       _-~o~  \/    |||  \\            _/~~-
 *        __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
 *    _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
 *  .~       .~       |   \\ -_    /  /-   /   ||      \   /
 * /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
 * |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
 *          '         ~-|      /|    |-~\~~       __--~~
 *                      |-~~-_/ |    |   ~\_   _-~            /\
 *                           /  \     \__   \/~                \__
 *                       _--~ _/ | .-~~____--~-/                  ~~==.
 *                      ((->/~   '.|||' -_|    ~~-/ ,              . _||
 *                                 -_     ~\      ~~---l__i__i__i--~~_/
 *                                 _-~-__   ~)  \--______________--~~
 *                               //.-~~~-~_--~- |-------~~~~~~~~
 *                                      //.-~~~--\
 *                               神兽保佑
 *                              代码无BUG!
 * @author mazaiting
 * @date 2019-07-10
 * @description
 */
class DetectStrategyModule
@Inject constructor(
    /**
     * 登录主持人
     */
    private val mPresenter: LoginPresenter?
) : BaseDetectStrategyModule() {

    override fun setParameters(param: Camera.Parameters): Camera.Parameters {
        return param
    }

    override fun detect(data: ByteArray) {
        // 检测
        mPresenter?.detect(data,
            object : IDetectCallback {
                override fun onDetectCompletion(status: FaceStatusEnum, message: String) {
                    mContext?.onDetectCompletion(
                        status,
                        message,
                        data
                    )
                }
            })
    }
}
